<?php

if ( !defined( 'CMS_ROOT' ) )
	die;

$PDO = Record::getConnection();

$sql = 'CREATE TABLE IF NOT EXISTS' . TABLE_PREFIX . 'reg_users_temp (
  id int(11) unsigned NOT NULL auto_increment,
  name varchar(100) default NULL,
  email varchar(255) default NULL,
  username varchar(40) NOT NULL,
  password varchar(40) default NULL,
  language varchar(5) default NULL,
  created_on datetime default NULL,
  updated_on datetime default NULL,
  created_by_id int(11) default NULL,
  updated_by_id int(11) default NULL,
  last_login datetime NOT NULL,
  rand_key varchar(50) NOT NULL,
  PRIMARY KEY  (id),
  UNIQUE KEY username (username)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;';

$PDO->exec( $sql );

$sql = "INSERT INTO " . TABLE_PREFIX . "permission (name) VALUES ('reg_user');";
$PDO->exec( $sql );

?>